Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

MAPSJS: Support dynamic overlays using dynamic attributes. #2171

Merged
merged 6 commits into from
Apr 23, 2021

Conversation

atomicsulfate
Copy link
Collaborator

@atomicsulfate atomicsulfate commented Apr 16, 2021

Textures can now be changed without tile reloading. An expression with
dynamic attributes can be used for textures. To change the texture,
the dynamic attribute can be set to an image URL, an HTMLImageElement
or an HTMLCanvasElement.

@atomicsulfate atomicsulfate force-pushed the MAPSJS-2783_DynamicTextureSupport branch 9 times, most recently from b4f72fb to 6ecaa25 Compare April 19, 2021 17:28
Textures can now be changed without tile reloading. An expression with
dynamic attributes can be used for textures. To change the texture,
the dynamic attribute can be set to an image URL, an HTMLImageElement
or an HTMLCanvasElement.

Signed-off-by: Andres Mandado <[email protected]>
@atomicsulfate atomicsulfate force-pushed the MAPSJS-2783_DynamicTextureSupport branch 2 times, most recently from d498516 to cb8a71c Compare April 20, 2021 08:28
@atomicsulfate atomicsulfate force-pushed the MAPSJS-2783_DynamicTextureSupport branch from cb8a71c to fdf255a Compare April 21, 2021 18:12
Signed-off-by: Andres Mandado <[email protected]>
@atomicsulfate atomicsulfate force-pushed the MAPSJS-2783_DynamicTextureSupport branch from fdf255a to d212e2f Compare April 22, 2021 07:15
@@ -35,6 +35,10 @@ export interface StyledProperties {
[name: string]: Expr | StylePropertyEvaluator | Value | undefined;
}

function isTextureProperty(propertyName: string): boolean {
return propertyName === "map" || propertyName.endsWith("Map");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which properties are we targetting with this, lightMap/aoMap, etc from Material? Isn't it safer to maintain a list of property names instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

texture in material.

Signed-off-by: Andres Mandado <[email protected]>
@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #2171 (705cb96) into master (92f3d29) will increase coverage by 0.15%.
The diff coverage is 79.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2171      +/-   ##
==========================================
+ Coverage   68.27%   68.43%   +0.15%     
==========================================
  Files         299      299              
  Lines       26469    26516      +47     
  Branches     5993     6006      +13     
==========================================
+ Hits        18073    18146      +73     
+ Misses       8396     8370      -26     
Impacted Files Coverage Δ
...rp-datasource-protocol/lib/TechniqueDescriptors.ts 95.16% <ø> (ø)
...re/harp-datasource-protocol/lib/TechniqueParams.ts 71.62% <ø> (+1.35%) ⬆️
@here/harp-mapview/lib/DecodedTileHelpers.ts 65.16% <66.66%> (+8.31%) ⬆️
@here/harp-mapview/lib/MapMaterialAdapter.ts 92.02% <97.05%> (+1.55%) ⬆️
@here/harp-datasource-protocol/lib/Techniques.ts 74.76% <100.00%> (+2.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92f3d29...705cb96. Read the comment docs.

- Use explict list of texture property names for techniques.
- Add map property to fill technique so that technique can be used
for overlays in jsapi.

Signed-off-by: Andres Mandado <[email protected]>
@atomicsulfate atomicsulfate force-pushed the MAPSJS-2783_DynamicTextureSupport branch from eb967f1 to 705cb96 Compare April 23, 2021 07:58
@atomicsulfate atomicsulfate merged commit 57993f8 into master Apr 23, 2021
@atomicsulfate atomicsulfate deleted the MAPSJS-2783_DynamicTextureSupport branch April 23, 2021 13:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants